#ifndef CHAT1_H
#define CHAT1_H

#include <QWidget>
#include <QTcpSocket>
#include <QAbstractSocket>

namespace Ui {
class chat1;
}

class chat1 : public QWidget
{
    Q_OBJECT

public:
    explicit chat1(const QString &username, QWidget *parent = nullptr);
    ~chat1();

signals:
    void closed();

protected:
    void closeEvent(QCloseEvent *event) override;

private slots:
    void on_people_clicked();
    void on_close_clicked();
    void onConnected();
    void onReadyRead();
    void onError(QAbstractSocket::SocketError socketError);
    void addClientPage(const QString& username);
    void deleteClientPage(const QString& username);
    void on_pushButton_4_clicked();
    void on_pushButton_3_clicked();
    void on_wenjian_clicked();
    void on_tiren_clicked();
    void on_jinyan_clicked();
    void on_jiejin_clicked();

private:
    Ui::chat1 *ui;
    QString m_username;
    QTcpSocket *socket;
    QString flag;
};

#endif // CHAT1_H
